package br.com.bean;

import java.io.Serializable;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;

import br.com.util.PropertiesUtil;

@Named
@ApplicationScoped
public class ApplicationBean  implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	/**************************************************************************/
	/** METODOS / VARIAVEIS REFERENTES A APLICA��O, INDEPENDENTES DE USUARIO **/
	/**************************************************************************/
	
	/**************************************************************************/
	/**                               ATRIBUTOS                              **/
	/**************************************************************************/
	
	/** VERSAO DO SISTEMA **/
	private String versao = this.getVersaoSistema("major") + "." + this.getVersaoSistema("minor") + "." + 
			this.getVersaoSistema("revision") + " - " + this.getVersaoSistema("dataBuild");
	
	/** TEXTO DO RODAPE **/
	private String textRodape = "(c) Copyright Miolo 2014 - Todos os direitos reservados.";
	
	/** DADOS INICIAIS FIXOS DOS SISTEMA **/
	static boolean fixosCriados;
	
	/** TEMPO DE EXIBI��O DE MENSAGENS - 5 SEGUNDOS **/
	private String timeGrowl = "5000" ;
	
	/** MARCARAS **/
	private String maskCpf   = "999.999.999-99"; 
	private String maskCnpj  = "99.999.999/9999-99"; 
	private String maskCep   = "99.999-999"; 
	private String maskFone  = "(99) 9999-9999"; 
	
	/** ESTADOS CIVIS **/
	private String[] listEstadoCivil = {"Solteiro", "Casado", "Viúvo" };
	
	/** ESTADOS  **/
	private String[] listUf = {"AC" , "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", 
			                  "MS", "MG", "PA", "PB","PR" ,"PE" ,"PI" ,"RJ" ,"RS" ,"RO", 
			                  "RR", "SC", "SP", "SE", "TO" };
	/** SEXO  **/
	private String[] listSexo = {"M","F" };	
	
	/** REGISTROS POR PAGINA  **/
	private Integer recordsPerPage = 20;
	
	/** REGISTROS POR PAGINA DO COMBO DE PAGINACAO **/
	private String recordsComboPage = "10, 20, 30";
	
	/**************************************************************************/
	/**                                METODOS                               **/
	/**************************************************************************/
	public String getVersaoSistema(String chave) {
		return PropertiesUtil.getVersaoChave(chave);
	}
	
	/**************************************************************************/
	/**                              GET's E SET's                           **/
	/**************************************************************************/
	
	public String getVersao() {
		return versao;
	}
	public void setVersao(String versao) {
		this.versao = versao;
	}
	public String getTimeGrowl() {
		return timeGrowl;
	}
	public void setTimeGrowl(String timeGrowl) {
		this.timeGrowl = timeGrowl;
	}

	public String getMaskCpf() {
		return maskCpf;
	}

	public void setMaskCpf(String maskCpf) {
		this.maskCpf = maskCpf;
	}

	public String getMaskCnpj() {
		return maskCnpj;
	}

	public void setMaskCnpj(String maskCnpj) {
		this.maskCnpj = maskCnpj;
	}

	public String getMaskCep() {
		return maskCep;
	}

	public void setMaskCep(String maskCep) {
		this.maskCep = maskCep;
	}

	public String getMaskFone() {
		return maskFone;
	}

	public void setMaskFone(String maskFone) {
		this.maskFone = maskFone;
	}

	public String[] getListEstadoCivil() {
		return listEstadoCivil;
	}

	public void setListEstadoCivil(String[] listEstadoCivil) {
		this.listEstadoCivil = listEstadoCivil;
	}

	public String[] getListUf() {
		return listUf;
	}

	public void setListUf(String[] listUf) {
		this.listUf = listUf;
	}

	public String[] getListSexo() {
		return listSexo;
	}

	public void setListSexo(String[] listSexo) {
		this.listSexo = listSexo;
	}

	public Integer getRecordsPerPage() {
		return recordsPerPage;
	}

	public void setRecordsPerPage(Integer recordsPerPage) {
		this.recordsPerPage = recordsPerPage;
	}

	public String getTextRodape() {
		return textRodape;
	}

	public void setTextRodape(String textRodape) {
		this.textRodape = textRodape;
	}
	
	public String getRecordsComboPage() {
		return recordsComboPage;
	}

	public void setRecordsComboPage(String recordsComboPage) {
		this.recordsComboPage = recordsComboPage;
	}
	
}
